package cn.com.demo.microservice.consumer.service.feign.Impl;

import cn.com.demo.microservice.consumer.service.feign.IUserAddFeignService;
import cn.com.demo.microservice.entity.AqUser;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class IUserFactory implements FallbackFactory<IUserAddFeignService> {

    @Override
    public IUserAddFeignService create(Throwable throwable) {
        return new IUserAddFeignService() {
            @Override
            public int addUser(AqUser user) {
                return -1;
            }
        };
    }
}
